hikey: clean sram before mcu used
authorHaojian Zhuang <[email protected]>
Wed, 11 Apr 2018 11:06:14 +0000 (19:06 +0800)
committerHaojian Zhuang <[email protected]>
Wed, 11 Apr 2018 11:06:14 +0000 (19:06 +0800)
Clean cache to flush parameters into SRAM before MCU using them.

Signed-off-by: Haojian Zhuang <[email protected]>
plat/hisilicon/hikey/hikey_bl2_setup.c

index 2d9768ff6b351dc8b7b270bbcb524e22481675c9..a3fc607bb241c5cf2836c59a1109e9c31c192403 100644 (file)
@@ -304,15 +304,13 @@ void bl2_platform_setup(void)
        hikey_gpio_init();
        hikey_pmussi_init();
        hikey_hi6553_init();
+       /* Clear SRAM since it'll be used by MCU right now. */
+       memset((void *)SRAM_BASE, 0, SRAM_SIZE);
 
        dsb();
        hikey_ddr_init(DDR_FREQ_800M);
        hikey_security_setup();
 
-       /* Clear SRAM since it'll be used by MCU right now. */
-       memset((void *)SRAM_BASE, 0, SRAM_SIZE);
-       clean_dcache_range(SRAM_BASE, SRAM_SIZE);
-
        hikey_boardid_init();
        init_acpu_dvfs();
        hikey_rtc_init();
@@ -321,6 +319,9 @@ void bl2_platform_setup(void)
 
        hikey_mmc_pll_init();
 
+       /* Clean SRAM before MCU used */
+       clean_dcache_range(SRAM_BASE, SRAM_SIZE);
+
        reset_dwmmc_clk();
        memset(&params, 0, sizeof(dw_mmc_params_t));
        params.reg_base = DWMMC0_BASE;